﻿@model DrillOnline.Services.DrillScenarios

@{
    ViewBag.Title = "Login";
}

<h2>请使用你的账号登录</h2>

<section style="float: left; width: 33%; min-height: 400px">
    <section id="menuol" style="float: right; width: 80%; margin-right: 4px;">

        @foreach (var item in Model.ActorGroups.OrderByDescending(v => v.Model.SortIndex))
        {
            if (!item.GroupKey.StartsWith("["))
            {
            <div class="itemlist bg-orange fg-white" id="@(item.ID.ToString("N"))">
                <a href="#">@(item.GroupKey)</a>
            </div>
            }
        }
    </section>
</section>

<section style="float: right; width: 66%; min-height: 400px">
    <section id="itemol" class="bg-white" style="float: left; width: 80%; margin-left: 4px; padding: 0px 12px 0px 12px;">

        @foreach (var item in Model.ActorGroups.OrderByDescending(v => v.Model.SortIndex))
        {
            if (!item.GroupKey.StartsWith("["))
            {
            <div style="display:none"  id="sd_@(item.ID.ToString("N"))">
                <h3>请选择你的账号:</h3>
                @using (Html.BeginForm())
                {     
                    <fieldset class="normal">
                        <legend>
                            <h3>请选择你的账号并输入密码登录:</h3>
                        </legend>
                        @if (item.Examiners != null)
                        {
                            foreach (var u in item.Examiners)
                            { 
                            <input class="normal" type="radio" id="user@(u.ActorKey)" name="user" value="@u.ActorKey"><label for="user@(u.ActorKey)"> @u.ActorKey</label>
                            }
                        }

                        <h3>请输入你的密码:</h3>
                        @Html.Password("pwd")
                        <hr />
                        @Helpers.Submit("登录")
                    </fieldset>                           
                }
            </div>
            }
        }

    </section>
</section>

<script type="text/javascript">
    $(function () {
        $("#menuol div").click(function () {

            $("#itemol div").hide();
            $("#itemol #sd_" + $(this).attr("id")).fadeIn();
            return false;
        });
    });
</script>
